home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / HYP / R-S / Stack Analyzer / stack.txt < prev   
Encoding:
Text File  |  1989-04-13  |  8.3 KB  |  291 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 3
  11. -- first background id: 2798
  12. -- card count: 3
  13. -- first card id: 2826
  14. -- list block id: 2351
  15. -- print block id: 3571
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 65376 bytes
  21. -- stack block size: 7680 bytes
  22. -- created by hypercard version: 0x01208000
  23. -- compacted by hypercard version: 0x01228000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x0000220000002200
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0xCC003300CC003300
  30. -- patterns[4]: 0xCC883322CC883322
  31. -- patterns[5]: 0xEE88BB22EE88BB22
  32. -- patterns[6]: 0xEECCBB33EECCBB33
  33. -- patterns[7]: 0xFFCCFF33FFCCFF33
  34. -- patterns[8]: 0xFFEEFFBBFFEEFFBB
  35. -- patterns[9]: 0xFFFFFFBBFFFFFFBB
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68.  
  69. on openStack
  70.   global dash1, dash2, saveName, theStack
  71.   if the version < 1.1 then
  72.     answer "This stack needs HyperCard v1.1 or higher. " with "Okay"
  73.     doMenu "Quit HyperCard"
  74.   end if
  75.   put "=================================================="& return into dash1
  76.   put "----------------------------------------"& return into dash2
  77.   hide menuBar
  78.   pass openStack
  79. end openStack
  80.  
  81.  
  82. -------------------------------------------------------------------
  83. -------------------------------------------------------------------
  84.  
  85. on doMenu choice
  86.   --this stack can get large, be sure we compress it
  87.   --this choice does not clear files (text field on card 3)
  88.   if choice is "Quit HyperCard" or  choice is "Home" then
  89.     go to card 1
  90.     show button "hide"
  91.     compressStack
  92.     hide button "hide"
  93.   end if
  94.   pass doMenu
  95. end doMenu
  96.  
  97.  
  98. -------------------------------------------------------------------
  99. -------------------------------------------------------------------
  100. -- routine to compress stack
  101.  
  102. on compressStack
  103.   if the freesize of this stack <=1000  then exit compressStack
  104.   answer "COMPRESS STACK! " & "    Size: " &round(size of this stack/1000) &"K    Waste: " &round(freesize of this stack/1000) &"K" with "no" or "OK"
  105.   if It is "no" then exit compressStack
  106.   put the userlevel into temp
  107.   set userlevel to 5
  108.   domenu "compact stack"
  109.   set userlevel to temp
  110. end compressStack
  111.  
  112.  
  113.  
  114. -----------------------------------------------------------------------
  115. -----------------------------------------------------------------------
  116. --                    * * * saveText * * *                           --
  117. -----------------------------------------------------------------------
  118. --level 1 = background field on card 1, other = file analysis
  119.  
  120. on saveText level
  121.   global theStack,saveName,analysis
  122.  
  123.  
  124.   --get file name
  125.   if saveName is empty and theStack is empty
  126.   then put "? ? ? ?.txt" into theText
  127. else
  128.   if saveName ‚↠empty then put saveName into theText
  129.   else put theStack &".txt" into theText
  130. end if
  131. ask "Store text in which file [? = list]" with theText
  132. if it is empty then
  133.   exit saveText
  134. end if
  135. put it into theText
  136. if first character of it is "?" then
  137.   put fileName("TEXT") into theText
  138.   if theText is empty then
  139.     exit saveText
  140.   end if
  141. end if
  142. put theText into fileNm
  143. put theText into saveText
  144. put theText into saveName
  145. open file fileNm
  146. --Search file for last tab, tabs separate blocks
  147. --of texts. This way several sets of information can to added
  148. --to file.
  149. repeat with i = 0 to 19
  150.   read from file fileNm until tab
  151.   put i into iNm
  152.   if it = empty then exit repeat
  153. end repeat
  154. if iNM = 19 then
  155.   answer "Exit. There are already 20 text file."
  156.   exit saveText
  157. end if
  158. put "text" into txt
  159. put "" into ict
  160. if iNm>0 then
  161.   if iNM>=2 then
  162.     put "s" after txt
  163.     put iNM into ict
  164.   end if
  165.   answer"This Text will be added to the existing " &ict && txt with "cancel" or "OK"
  166.   if it = "cancel" then
  167.     exit saveText
  168.   end if
  169. end if
  170. write formfeed to file fileNm
  171. if level = 1 then write bkgnd field 1 to file fileNm
  172. else write analysis to file fileNm
  173. write tab to file fileNm
  174. end saveText
  175.  
  176. ----------------------------------------------------------------------
  177. ----------------------------------------------------------------------
  178. --                 setLocks
  179. ----------------------------------------------------------------------
  180.  
  181. --locking messages, screen, etc keeps your stack
  182. --in control (rather than the stack being analyzed)
  183.  
  184. on setLocks flag
  185.   if flag then set cursor to 4 else pop card
  186.   if flag then set lockScreen to true else set lockScreen to false
  187.   if flag then set LockRecent to true else set lockRecent to false
  188.   if flag then push this card else set cursor to 1
  189. end setLocks
  190.  
  191.  
  192.  
  193. ---------------------------------------------------------------
  194. --SYSTEM STUFF
  195. ---------------------------------------------------------------
  196.  
  197. on xy -- puts the mouse location in the message box until a mouse click
  198.   repeat until the mouse is down
  199.     put the mouseLoc
  200.   end repeat
  201. end xy
  202.  
  203. on c
  204.   choose browse tool
  205.   doMenu "Card Info..."
  206. end c
  207.  
  208. on b
  209.   choose browse tool
  210.   doMenu "Bkgnd Info..."
  211. end b
  212.  
  213. on s
  214.   choose browse tool
  215.   doMenu "Stack Info..."
  216. end s
  217.  
  218. on startUp
  219.   getHomeInfo
  220.   pass startUp -- to a startUp XCMD, if present
  221. end startUp
  222.  
  223. on resume
  224.   getHomeInfo
  225.   pass resume -- to a resume XCMD, if present
  226. end resume
  227.  
  228. on getHomeInfo
  229.   global stacks,applications,documents,userName
  230.   set lockScreen to true
  231.   set lockMessages to true
  232.   push this card
  233.   go to card "User Preferences" of stack "Home"
  234.   put card field "User Name" into userName
  235.   set userLevel to card field "User Level"
  236.   set powerKeys to the hilite of button "Power Keys"
  237.   set textArrows to the hilite of button "Text Arrows"
  238.   set blindTyping to the hilite of button "Blind Typing"
  239.   put field "paths" of card "stacks" into stacks
  240.   put field "paths" of card "applications" into applications
  241.   put field "paths" of card "documents" into documents
  242.   pop card
  243.   set lockScreen to false
  244.   set lockMessages to false
  245. end getHomeInfo
  246.  
  247. on searchScript pattern,stackName -- search all scripts of a stack
  248.   set lockMessages to true
  249.   if stackName is not empty then go to stack stackName
  250.  
  251.   if the script of this stack contains pattern
  252.   then edit script of this stack
  253.  
  254.   repeat with i = 1 to the number of bkgnds
  255.     go to card 1 of bkgnd i
  256.     if the script of this bkgnd contains pattern
  257.     then edit script of bkgnd
  258.  
  259.     repeat with j = 1 to the number of bkgnd buttons
  260.       if the script of bkgnd button j contains pattern
  261.       then edit script of bkgnd button j
  262.     end repeat
  263.  
  264.     repeat with j = 1 to the number of bkgnd fields
  265.       if the script of bkgnd field j contains pattern
  266.       then edit script of bkgnd field j
  267.     end repeat
  268.  
  269.   end repeat
  270.  
  271.   repeat with i = 1 to the number of cards
  272.     go card i
  273.     if the script of this card contains pattern
  274.     then edit script of this card
  275.  
  276.     repeat with j = 1 to the number of card buttons
  277.       if the script of card button j contains pattern
  278.       then edit script of card button j
  279.     end repeat
  280.  
  281.     repeat with j = 1 to the number of card fields
  282.       if the script of card field j contains pattern
  283.       then edit script of card field j
  284.     end repeat
  285.  
  286.   end repeat
  287.   set lockMessages to false
  288. end searchScript
  289.  
  290.  
  291.